
<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      layout:decorate="~{admin/layout}">
<body>

<div class="content-wrap" layout:fragment="content">
    <style>
        .col-md-3 {
            width: 20%;
        }
        .imgtree{
            height: 20px;
            width: 20px;
        }
        .icon-list-item .glyphicon, .icon-list-item .fa {
            width: 20px;
            margin-right: 10px;
        }
        .form-actions {
            margin: 1rem 0 0;
            padding: 1rem;
            background-color: #fff;
        }
        .fa-unlock-alt{
            color: #c20000;
        }
    </style>
    <script th:src="@{/vendor/shufflejs/dist/jquery.shuffle.modernizr.min.js}"></script>
    <script th:src="@{/vendor/magnific-popup/dist/jquery.magnific-popup.min.js}"></script>
    <script th:src="@{/js/gallery.js}"></script>
    <main id="content" class="content" role="main">
        <ol class="breadcrumb">
            <li>地块总览</li>
            <li class="active"><span class="fw-semi-bold"><span th:text="${landMass.areaLocation.serialNumber}+${landMass.serialNumber}"></span> 地块</span></li>
        </ol>
        <div class="col-lg-6">
            <div class="clearfix">
                <ul class="nav nav-tabs pull-xs-left" id="myTab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="home-tab" data-toggle="tab" href="#basic-tab" role="tab" aria-controls="basic" aria-expanded="true">总览</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="tree-put" data-toggle="tab" href="#basic-put" role="tab" aria-controls="basic-put" aria-expanded="false">入库</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="tree-out" data-toggle="tab" href="#basic-out" role="tab" aria-controls="basic-out" aria-expanded="false">出库/号苗/死苗</a>
                    </li>
                </ul>
            </div>
            <div class="tab-content mb-lg" id="myTabContent">
                <div role="tabpanel" class="tab-pane active in clearfix" id="basic-tab" aria-labelledby="basic" aria-expanded="true">
                    统计汇总<br>
                    <span th:text="${collect}"></span>&nbsp;;&nbsp;&nbsp;&nbsp;<span id="twshow"><i class="fa fa-circle-o"></i>:空树坑</span>&nbsp;&nbsp;<br>
                    <font color="#1afa29" th:if="${tree1 != null}"><img class="sanj" th:src="@{/img/tree/三角形-红.png}">:<span th:text="${tree1}"></span>&nbsp;&nbsp;</font>
                    <font color="#f4ea2a" th:if="${tree2 != null}"><img class="sanj" th:src="@{/img/tree/三角形-黄.png}">:<span th:text="${tree2}"></span>&nbsp;&nbsp;</font>
                    <font color="#d81e06" th:if="${tree3 != null}"><img class="sanj" th:src="@{/img/tree/三角形-绿.png}">:<span th:text="${tree3}"></span>&nbsp;&nbsp;</font>
                    <font color="#1296db" th:if="${tree4 != null}"><img class="sanj" th:src="@{/img/tree/三角形-蓝.png}">:<span th:text="${tree4}"></span>&nbsp;&nbsp;</font>
                    <font color="#13227a" th:if="${tree5 != null}"><img class="sanj" th:src="@{/img/tree/三角形-紫.png}">:<span th:text="${tree5}"></span>&nbsp;&nbsp;</font>
                   <div class="row icon-list">
                       <div th:each="treeWells :${treeWell}" class="icon-list-item col-md-3 col-sm-4" >
                            <div th:if="${treeWells.salesState == 0}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true"  th:data-original-title=" ${treeWells.serialNumber}" data-placement="bottom">
                                    <i class="fa fa-circle-o"></i>
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>

                            <div th:if="${treeWells.salesState == 1}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                    <img class="sanj" th:src="@{/img/tree/三角形-红.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>

                            <div th:if="${treeWells.salesState == 2}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                    <img class="sanj" th:src="@{/img/tree/三角形-黄.png}"  th:value="${treeWells.tree_id}"  data-toggle="modal"  data-target="#myModal19" >
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>

                            <div th:if="${treeWells.salesState == 3}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                    <img class="sanj" th:src="@{/img/tree/三角形-绿.png}" th:value="${treeWells.tree_id}"  data-toggle="modal" data-target="#myModal19" >
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>

                            <div th:if="${treeWells.salesState == 4}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                    <img class="sanj" th:src="@{/img/tree/三角形-蓝.png}" th:value="${treeWells.tree_id}"  data-toggle="modal"  data-target="#myModal19" >
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>

                            <div th:if="${treeWells.salesState == 5}">
                                <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                    <img class="sanj" th:src="@{/img/tree/三角形-紫.png}" th:value="${treeWells.tree_id}"  data-toggle="modal" data-target="#myModal19">
                                    <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                </p>
                            </div>
                       </div>
                 </div>
                </div>
                <div class="tab-pane" id="basic-put" role="tabpanel" aria-labelledby="assumtion-tab" aria-expanded="false">
                    <form th:action="@{/admin/treeWell/put}" enctype="multipart/form-data" id="put-form"  class="form-horizontal form-label-left" method="post">
                       <input type="hidden" name="landMass_id" id="landMass_id" th:value="${landMass.landMass_id}">
                        <span class="label label-warning  text-gray-dark mr-xs">入库</span>信息
                        <fieldset>
                            <legend>
                            </legend>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="basic">树木品种</label>
                                <div class="col-sm-9">
                                    <input type="text" id="basic" name="treeSpecies" class="form-control" required="required">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="basic-change">
                                    胸径/地径
                                    <span class="help-block">
                                    </span>
                                </label>
                                <div class="col-sm-9">
                                    <input type="text" id="basic-change" name="chestBreadth" class="form-control" required="required">
                                </div>
                            </div>
                        </fieldset>
                        <fieldset>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="number" required="required">
                                    冠幅
                                </label>
                                <div class="col-sm-9">
                                    <input type="text"  name="crownWidth" id="guanfu" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="number">
                                    高度
                                </label>
                                <div class="col-sm-9">
                                    <input type="text" id="number" name="height" class="form-control" required="required">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-sm-3">
                                    枝条数量
                                </label>
                                <div class="col-sm-9">
                                    <input type="text" id="zhitiao"  name="salenumber" class="form-control" >
                                </div>
                            </div>
                            <shiro:hasAnyRoles name="admin,finance">
                                <div class="form-group row">
                                    <label class="control-label col-sm-3">
                                        价格
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text"   name="cost" class="form-control" >
                                    </div>
                                </div>
                            </shiro:hasAnyRoles>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="number">
                                    备注
                                </label>
                                <div class="col-sm-9">
                                    <input type="text"  name="remark" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-sm-3" for="number">
                                    图片上传
                                </label>
                                <div class="col-sm-9">
                                    <input type="file" name="file" />
                                </div>
                            </div>
                        </fieldset>
                        <fieldset>
                            <legend>
                               <span class="label label-warning  text-gray-dark mr-xs">选择</span>树坑
                            </legend>
                            <div id="list" th:each="treeWells :${treeWell}" class="icon-list-item col-md-3 col-sm-4" >
                                <div  th:if="${treeWells.salesState == 0}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title=" ${treeWells.serialNumber}" data-placement="bottom">
                                        <input th:id="${treeWells.serialNumber+'r'}" th:value="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" class="puttree" type="checkbox" name="treeWell_id">
                                        <i class="fa fa-circle-o"></i>
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                            </div>
                        </fieldset>
                        <!--<input type="button" value="恢复" class="btn" id="recover">-->
                        输入范围:<input class="fanwei"  type="text" name="stat" id="stat" >~
                        <input class="fanwei" type="text" name="stop" id="stop" >
                        <input type="button" id="affirm" class="btn" value="确认">
                        <input type="button" value="全选" class="btn" id="selectAll">
                        <input type="button" value="复原" class="btn" id="unSelect">
                        <script>
                            $(function () {
                                $("#submit1").click(function () {
                                    var str='树种：<span>'+$("#basic").val()+'</span> ;&nbsp;&nbsp; ' +
                                        ' 胸径：<span>'+$("#basic-change").val()+'</span>-<span>'+$("#basic-changemax").val()+'</span> ;&nbsp;&nbsp;'+
                                        '冠幅：<span>'+$("#guanfu").val()+'</span>-<span>'+$("#guanfumax").val()+'</span> ;&nbsp;&nbsp;'+
                                        '高度：<span>'+$("#number").val()+'</span>-<span>'+$("#numbermax").val()+'</span> ;&nbsp;&nbsp;'+
                                        '枝条：<span>'+$("#zhitiao").val()+'</span>-<span>'+$("#zhitiao").val()+'</span>';

                                    document.getElementById('huixian').innerHTML=str;
                                    $("#subtype").val(1);
                                    $(".frommodel").hide();

                                    $(".puttree").each(function () {
                                        if($(this).is(':checked')){
                                            $('#q_'+$(this).attr("value")).show();
                                        }
                                    });
                                });
                                $("#submit2").click(function () {
                                    if($("#subtype").val()==1){
                                        if($("#basic").val()==""){
                                            alert("请填写树种");
                                            return false;
                                        }
                                        if($("#basic-change").val()==""){
                                            alert("请填写胸径");
                                            return false;
                                        }
                                        if($("#guanfu").val()==""){
                                            alert("请填写冠幅");
                                            return false;
                                        }
                                        if($("#number").val()==""){
                                            alert("请填写高度");
                                            return false;
                                        }
                                        if(number==""){
                                            alert('请选择入库树坑！');
                                            return false;
                                        }
                                        $("#put-form").submit();
                                    }
                                });
                            });
                        </script>
                        <input class="btn btn-gray" style="width: 60px;" data-toggle="modal" id="submit1" value="入库" data-target="#myModal18">
                        <script>
                            $(".sanj").click(function () {
                                $.ajax({
                                    url: "/admin/tree/getimg",
                                    type: 'GET',
                                    data:{"treeid":$(this).attr("value")},
                                    async: false,
                                    success: function (data) {
                                       if(data!=null){
                                           var srt='<span>当前成本:'+data.cost+'</span><br><span>产地:'+data.location+'</span>';
                                         document.getElementById('infoall').innerHTML=srt;
                                           if(data.imgurl.length>26){
                                               $("#imgurl").attr("src",data.imgurl);
                                           }else {
                                               $("#imgurl").hide();
                                               $("#err").show();
                                           }
                                       }
                                    },
                                    error: function (xhr) {
                                        console.log("error")
                                    }
                                });

                            });
                            var chk_value =[];
                            $("#selectAll").click(function () {
                                saveval();
                                $("#list :checkbox,#all").prop("checked", true);
                            });

                            $("#unSelect").click(function () {
                                saveval();
                                $("#list :checkbox,#all").prop("checked", false);
                            });

                            $("#recover").click(function () {
                                $("#list :checkbox,#all").prop("checked", false);
                                for(var i=0;i<chk_value.length;i++){
                                    $('#'+chk_value[i]).prop("checked", true);
                                }

                            });

                            $("#affirm").click(function () {
                                saveval();
                                $("#list :checkbox,#all").prop("checked", false);
                                var stat=Number($("#stat").val());
                                var stop=Number($("#stop").val());
                                for(var i=stat;i<=stop;i++){
                                    $('#'+i+"r").prop("checked", true);
                                }
                            });

                            function saveval(){
                                $('input[name="treeWell_id"]:checked').each(function(){
                                    console.log($(this).attr("id"));
                                    chk_value.push($(this).attr("id"));
                                });
                            }
                        </script>
                    </form>
                </div>
                <div class="tab-pane" id="basic-out" role="tabpanel" aria-labelledby="assumtion-tab"  aria-expanded="false">
                    <div class="form-horizontal form-label-left">
                        <input type="hidden" name="landMass_id" th:value="${landMass.landMass_id}">
                        <div>
                            <input value="出库" id="puttree" data-toggle="modal" data-target="#myModal18" class="btn btn-info width-100 mb-xs" role="button">
                            <input value="号苗" id="signtree" class="btn btn-primary width-100 mb-xs" role="button">
                            <input value="死苗" id="dietree" class="btn btn-danger width-100 mb-xs" role="button">
                            <input value="更新" id="updatetree" class="btn btn-danger width-100 mb-xs" role="button">
                            <input value="备注" id="remarks" class="btn btn-danger width-100 mb-xs" role="button">
                        </div>
                        <div id="priceandlocation" style="display: none">
                            备注: <input type="text" id="remark">
                            周期: <input type="text" id="look">
                            <input type="submit" id="priceadd">
                        </div>
                        <div id="remarkstxt" style="display: none">
                            备注: <textarea type="text" id="remarksvar"></textarea>
                            <input type="submit" id="remarksadd">
                        </div>
                        <div id="updateinfo" style="display: none">
                            <form  th:action="@{/admin/tree/updatetree}" enctype="multipart/form-data"  class="form-horizontal form-label-left" method="post">
                                <input type="hidden" name="landMass_id" th:value="${landMass.landMass_id}">
                                <input type="hidden" name="treeids" id="treeids">
                                <span class="label label-warning  text-gray-dark mr-xs">入库</span>信息
                                <fieldset>
                                    <legend>
                                    </legend>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" for="basic-change">
                                            胸径/地径
                                            <span class="help-block"></span>
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="chestBreadth" name="chestBreadth" class="form-control" required="required">
                                            <input type="text"  name="chestBreadthmax" class="form-control" required="required">
                                        </div>
                                    </div>
                                </fieldset>
                                <fieldset>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" for="number" required="required">
                                            冠幅
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"  name="crownWidth"  class="form-control">
                                            <input type="text"  name="crownWidthmax" class="form-control">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" for="number">
                                            高度
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"  name="height" class="form-control" required="required">
                                            <input type="text"  name="heightmax" class="form-control" required="required">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3">
                                            枝条数量
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"   name="salenumber" class="form-control" >
                                            <input type="text"   name="salenumbermax" class="form-control" >
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" for="number">
                                            备注
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"  name="remark" class="form-control">
                                        </div>
                                    </div>
                                    <shiro:hasAnyRoles name="admin,finance">
                                        <div class="form-group row">
                                            <label class="control-label col-sm-3">
                                                价格
                                            </label>
                                            <div class="col-sm-9">
                                                <input type="text"   name="cost" class="form-control" >
                                            </div>
                                        </div>
                                    </shiro:hasAnyRoles>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" for="number">
                                            图片上传
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="file" id="file" name="file" />
                                            <button type="submit" id="sub" class="btn btn-danger btn-rounded">提交</button>
                                        </div>
                                    </div>
                                </fieldset>
                            </form>
                        </div>
                        统计汇总 &nbsp;&nbsp;<span th:text="${collect}"></span><br>
                        <font color="#1afa29" th:if="${tree1 != null}"><img class="sanj" th:src="@{/img/tree/三角形-红.png}">:<span th:text="${tree1}"></span>&nbsp;&nbsp;</font>
                        <font color="#f4ea2a" th:if="${tree2 != null}"><img class="sanj" th:src="@{/img/tree/三角形-黄.png}">:<span th:text="${tree2}"></span>&nbsp;&nbsp;</font>
                        <font color="#d81e06" th:if="${tree3 != null}"><img class="sanj" th:src="@{/img/tree/三角形-绿.png}">:<span th:text="${tree3}"></span>&nbsp;&nbsp;</font>
                        <font color="#1296db" th:if="${tree4 != null}"><img class="sanj" th:src="@{/img/tree/三角形-蓝.png}">:<span th:text="${tree4}"></span>&nbsp;&nbsp;</font>
                        <font color="#13227a" th:if="${tree5 != null}"><img class="sanj" th:src="@{/img/tree/三角形-紫.png}">:<span th:text="${tree5}"></span>&nbsp;&nbsp;</font>
                        <fieldset>
                            <div id="treelist" th:each="treeWells :${treeWell}" class="icon-list-item col-md-3 col-sm-4">
                                <div th:if="${treeWells.salesState == 1}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                        <input class="tree" th:id="${'_'+treeWells.serialNumber}" th:value="${treeWells.tree_id}" th:treeWell_id="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" type="checkbox" name="tree_id">
                                        <img class="sanj" th:src="@{/img/tree/三角形-红.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                                <div th:if="${treeWells.salesState == 2}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                        <input class="tree" th:id="${'_'+treeWells.serialNumber}"  th:value="${treeWells.tree_id}" th:treeWell_id="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" type="checkbox" name="tree_id">
                                        <img class="sanj" th:src="@{/img/tree/三角形-黄.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                                <div th:if="${treeWells.salesState == 3}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                        <input class="tree" th:id="${'_'+treeWells.serialNumber}"  th:value="${treeWells.tree_id}" th:treeWell_id="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" type="checkbox" name="tree_id">
                                        <img class="sanj" th:src="@{/img/tree/三角形-绿.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                                <div th:if="${treeWells.salesState == 4}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                        <input class="tree"  th:id="${'_'+treeWells.serialNumber}"  th:value="${treeWells.tree_id}" th:treeWell_id="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" type="checkbox" name="tree_id">
                                        <img class="sanj" th:src="@{/img/tree/三角形-蓝.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                                <div th:if="${treeWells.salesState == 5}">
                                    <p class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                        <input class="tree" th:id="${'_'+treeWells.serialNumber}"  th:value="${treeWells.tree_id}" th:treeWell_id="${treeWells.treeWell_id}" th:serialNumber=" ${treeWells.serialNumber}" type="checkbox" name="tree_id">
                                        <img class="sanj" th:src="@{/img/tree/三角形-紫.png}" th:value="${treeWells.tree_id}" data-toggle="modal"  data-target="#myModal19" >
                                        <img th:if="${treeWells.state==3}" class="suod" th:src="@{/img/锁.png}">
                                    </p>
                                </div>
                            </div>
                        </fieldset>
                        <!--<input type="button" value="恢复" class="btn" id="recover4">-->
                        输入范围:<input class="fanwei" type="text" name="stat" id="stat4" >~
                        <input class="fanwei" type="text" name="stop" id="stop4">
                        <input type="button" id="affirm4"  class="btn" value="确认">
                        <input type="button" value="全选" class="btn" id="treeselectAll">
                        <input type="button" value="复原" class="btn" id="treeunSelect">
                        <script>
                            showtw();
                            var chk_value4 =[];
                            $("#treeselectAll").click(function () {
                                saveval4();
                                $("#treelist :checkbox,#all").prop("checked", true);
                            });

                            $("#treeunSelect").click(function () {
                                saveval4();
                                $("#treelist :checkbox,#all").prop("checked", false);
                            });

                            $("#recover4").click(function () {
                                $("#treelist :checkbox,#all").prop("checked", false);
                                for(var i=0;i<chk_value4.length;i++){
                                    $('#'+chk_value4[i]).prop("checked", true);
                                }

                            });

                            $("#affirm4").click(function () {
                                saveval4();
                                $("#treelist :checkbox,#all").prop("checked", false);
                                var stat=Number($("#stat4").val());
                                var stop=Number($("#stop4").val());
                                console.log(stat+"======"+stop);
                                if(stat<stop){
                                    console.log(true);
                                }else {
                                    console.log(false);
                                }
                                for(stat;stat<=stop;stat++){
                                    $('#'+'_'+stat).prop("checked", true);
                                }

                            });

                            function saveval4(){
                                $('input[name="tree_id"]:checked').each(function(){
                                    chk_value4.push($(this).attr("id"));
                                });
                            }
                        </script>
                    </div>
                    <script>
                        $(function () {
                            $("#puttree").click(function () {
                                var str="";
                                $("#subtype").val(2);
                                $(".frommodel").hide();
                                $(".tree").each(function (i, obj) {
                                    if($(this).is(':checked')){
                                        str=str+($(this).attr("value")+";");
                                        console.log($('#q_'+$(this).attr("treeWell_id")).show());
                                    }
                                });
                                $("#submit2").click(function () {
                                    if($("#subtype").val()==2){
                                        $.ajax({
                                            url: "/admin/tree/outtree",
                                            type: 'POST',
                                            data:{"treeids":str},
                                            async: false,
                                            success: function (data) {
                                                console.log(data);
                                                location.reload();
                                            },
                                            error: function (xhr) {
                                                console.log("error")
                                            }
                                        });
                                    }
                                });
                            });

                            $("#signtree").click(function () {
                                $("#priceandlocation").toggle();
                                console.log("log");
                                $("#priceadd").click(function(){
                                    var str="";
                                    $(".tree").each(function (i, obj) {
                                        if($(this).is(':checked')){
                                            str=str+($(this).attr("value")+";");
                                        }
                                    });
                                    if(str!=""){
                                        var price=$("#price").val();
                                        var remark=$("#remark").val();
                                        if(remark!=null&&remark.length>0){
                                            $.ajax({
                                                url: "/admin/tree/marktree",
                                                type: 'POST',
                                                data:{"treeids":str,"remark":remark,"look":$("#look").val()},
                                                async: false,
                                                success: function (data) {
                                                    console.log(data);
                                                    location.reload();
                                                },
                                                error: function (xhr) {
                                                    console.log("error")
                                                }
                                            });
                                        }else {
                                            alert("请填写备注");
                                        }

                                    }
                                });
                            });

                            $("#remarks").click(function () {
                                $("#remarkstxt").toggle();
                                console.log("log");
                                $("#remarksadd").click(function(){
                                    var remarksvar=$("#remarksvar").val();
                                    if(remarksvar!=null&&remarksvar.length>0){
                                        $.ajax({
                                            url: "/admin/landMass/remarks",
                                            type: 'POST',
                                            data:{"landMass_id":$("#landMass_id").val(),"remarks":remarksvar},
                                            async: false,
                                            success: function (data) {
                                                console.log(data);
                                                location.reload();
                                            },
                                            error: function (xhr) {
                                                console.log("error")
                                            }
                                        });
                                    }else {
                                        alert("请填写备注");
                                    }
                                });
                            });

                            $("#dietree").click(function () {
                                var str="";
                                $(".tree").each(function (i, obj) {
                                    if($(this).is(':checked')){
                                        str=str+($(this).attr("value")+";");
                                    }
                                });
                                console.log(str);
                                $.ajax({
                                    url: "/admin/tree/dietree",
                                    type: 'POST',
                                    data:{"treeids":str},
                                    async: false,
                                    success: function (data) {
                                        console.log(data);
                                        location.reload();
                                    },
                                    error: function (xhr) {
                                        console.log("error")
                                    }
                                });
                            });

                            $("#updatetree").click(function () {
                                $("#updateinfo").toggle();
                                $("#sub").click(function(){
                                    var str="";
                                    $(".tree").each(function (i, obj) {
                                        if($(this).is(':checked')){
                                            str=str+($(this).attr("value")+";");
                                        }
                                    })
                                    if(str!=""){
                                        $("#treeids").val(str);
                                        $("#basic-out").submit();
                                    }
                                });

                            });
                        });
                    </script>
                </div>
            </div>
            <div class="modal fade" id="myModal18" tabindex="-1" role="dialog" aria-labelledby="myModalLabel18" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h5 class="modal-title text-xl-center fw-bold mt" id="myModalLabel18">选择确认</h5>
                        </div>
                        <div id="huixian"></div>
                        <div class="modal-body bg-gray-lighter">

                            <div>
                                <div class="row icon-list">
                                    <input id="subtype" type="hidden">
                                    <div th:each="treeWells :${treeWell}" class="icon-list-item col-md-3 col-sm-4" >
                                        <div class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 0}">
                                            <p class="hidden-md-down" data-toggle="tooltip" data-html="true"  th:data-original-title=" ${treeWells.serialNumber}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>

                                        <div  class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 1}">
                                            <p  class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>

                                        <div class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 2}">
                                            <p  class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>

                                        <div  class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 3}">
                                            <p  class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>

                                        <div  class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 4}">
                                            <p  class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>

                                        <div  class="frommodel" style="display:none;" th:id="${'q_'+treeWells.treeWell_id}" th:if="${treeWells.salesState == 5}">
                                            <p  class="hidden-md-down" data-toggle="tooltip" data-html="true" th:data-original-title="${treeWells.titles}" data-placement="bottom">
                                                <i class="fa fa-tree"></i>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button id="submit2" class="btn btn-danger btn-rounded pull-xs-right">提交</button>
                                    <button type="button" class="btn btn-gray" data-dismiss="modal">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal fade" id="myModal19" tabindex="-1" role="dialog" aria-labelledby="myModalLabel19" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        </div>
                        <img id="imgurl" style="height: 600px;width: 598px;">
                        <h5 id="err" style="display: none;text-align:center;">暂无图像 </h5>
                        <shiro:hasAnyRoles name="admin,finance">
                            <div id="infoall"></div>
                        </shiro:hasAnyRoles>
                    </div>
                </div>
            </div>
        </div>
    </main>
</div>
</body>
</html>